~ chicken-core (master) /manual/Module (chicken platform)
Trap1[[tags: manual]]
2[[toc:]]
3
4== Module (chicken platform)
5
6This module provides procedures for obtaining information about the
7platform on which the program is currently running.
8
9=== Build information
10
11These procedures return information about options that can be
12specified at build time.
13
14==== build-platform
15
16<procedure>(build-platform)</procedure>
17
18Returns a symbol specifying the toolset which has been used for
19building the executing system, which is one of the following:
20
21 cygwin
22 mingw
23 gnu
24 intel
25 clang
26 sun
27 unknown
28
29==== chicken-version
30
31<procedure>(chicken-version [FULL])</procedure>
32
33Returns a string containing the version number of the CHICKEN runtime
34system. If the optional argument {{FULL}} is given and true, then
35a full version string is returned.
36
37==== include-path
38
39<procedure>(include-path [PATHLIST])</procedure>
40
41Returns a list of directory names where {{include}} and {{include-ci}} locate
42files to be included. If {{PATHLIST}} is given, the current include path
43is changed to that value, which must be a list of strings.
44
45==== repository-path
46
47<parameter>repository-path</parameter>
48
49Contains a list of strings naming the paths to the extension
50repository, which defaults to the value of the environment variable
51{{CHICKEN_REPOSITORY_PATH}}, split on {{:}} (or {{;}} on Windows). If
52the environment variable is not set, it will be a list containing the
53default library path (usually {{/usr/local/lib/chicken}} on UNIX
54systems).
55
56==== installation-repository
57
58<parameter>installation-repository</parameter>
59
60Contains the name of the directory where extensions are installed
61(as opposed to the possible locations where they can be loaded or
62linked at runtime.)
63
64
65=== system-config-directory
66
67<procedure>(system-config-directory)</procedure>
68
69Returns the location of the directory for configuration files. This
70obeys the XDG specification, so when the {{XDG_CONFIG_HOME}}
71environment variable is set, its value is used. When it's not set, it
72will default to {{$HOME/.config}} on UNIX and {{$APPDATA}} on Windows.
73
74
75=== system-cache-directory
76
77<procedure>(system-cache-directory)</procedure>
78
79Returns the location of the directory for caches. This obeys the XDG
80specification, so when the {{XDG_CACHE_HOME}} environment variable is
81set, its value is used. When it's not set, it will default to
82{{$HOME/.cache}} on UNIX and {{$LOCALAPPDATA}} or {{$APPDATA}} on
83Windows.
84
85
86=== Machine information
87
88These procedures return information about the type of CPU/architecture
89the program is running on.
90
91==== machine-byte-order
92
93<procedure>(machine-byte-order)</procedure>
94
95Returns the symbol {{little-endian}} or {{big-endian}}, depending on the
96machine's byte-order.
97
98
99==== machine-type
100
101<procedure>(machine-type)</procedure>
102
103Returns a symbol specifying the processor on which this process is
104currently running, which is one of the following:
105
106 arm
107 alpha
108 mips
109 hppa
110 ultrasparc
111 sparc
112 ppc
113 ppc64
114 ia64
115 x86
116 x86-64
117 unknown
118
119=== Software information
120
121These procedures return information about the type of operating system
122the program is running on.
123
124==== software-type
125
126<procedure>(software-type)</procedure>
127
128Returns a symbol specifying the operating system on which this process
129is currently running, which is one of the following:
130
131 android
132 windows
133 unix
134 ecos
135 unknown
136
137
138==== software-version
139
140<procedure>(software-version)</procedure>
141
142Returns a symbol specifying the operating system version on which this
143process is currently running, which is one of the following:
144
145 linux
146 freebsd
147 netbsd
148 openbsd
149 macosx
150 hpux
151 dragonfly
152 haiku
153 solaris
154 sunos
155 aix
156 hurd
157 unknown
158
159
160=== Feature identifiers
161
162
163CHICKEN maintains a global list of ''features'' naming functionality available
164in the current system. Additionally the {{cond-expand}} form accesses this
165feature list to infer what features are provided. Predefined features are
166{{chicken}}, and the SRFIs (Scheme Request For Implementation) provided by the
167base system: {{srfi-23, srfi-30, srfi-39}}. If the {{eval}} unit
168is used (the default), the features {{srfi-0, srfi-2, srfi-6, srfi-8, srfi-9}}
169and {{srfi-10}} are defined. When compiling code (during compile-time) the
170feature {{compiling}} is registered. When evaluating code in the interpreter
171(csi), the feature {{csi}} is registered.
172
173
174==== feature?
175
176<procedure>(feature? ID ...)</procedure>
177
178Returns {{#t}} if all features with the given feature-identifiers {{ID ...}}
179are registered.
180
181
182==== register-feature!
183
184<procedure>(register-feature! FEATURE ...)</procedure>
185
186Register one or more features that will be accepted as valid
187feature-identifiers by {{cond-expand}}. {{FEATURE ...}} may
188be a keyword, string or symbol.
189
190
191==== unregister-feature!
192
193<procedure>(unregister-feature! FEATURE ...)</procedure>
194
195Unregisters the specified feature-identifiers. {{FEATURE ...}}
196may be a keyword, string or symbol.
197
198
199=== Returning to the host program
200
201=== return-to-host
202
203<procedure>(return-to-host)</procedure>
204
205Exits the Scheme code and returns to the invoking context that called
206{{CHICKEN_run}} or {{CHICKEN_continue}}.
207
208After {{return-to-host}} has been executed and once {{CHICKEN_run}}
209returns, you can invoke callbacks which have been defined with
210{{define-external}}.
211
212
213---
214Previous: [[Module (chicken pathname)]]
215
216Next: [[Module (chicken plist)]]